<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>改变事件</title>
  </head>
  <body>
    <input type="text" id="user" autocomplete="off" />
    <select id="province">
      <option>风</option>
      <option>林</option>
      <option>火</option>
      <option>山</option>
    </select>
    <script>
      let userEle = document.getElementById("user");
      let provinceEle = document.getElementById("province");

      // 绑定内容改变事件
      userEle.addEventListener("input", function () {
        console.log(this.value);
      });

      // 给下拉框绑定change事件
      provinceEle.addEventListener("change", function () {
        
        console.dir(this.value);
      });
    </script>
  </body>
</html>
